/*
//
//              INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license  agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in  accordance  with the terms of that agreement.
//    Copyright (c) 2007 Intel Corporation. All Rights Reserved.
//
//
*/

#ifndef __UMC_AVS_COEFFS_BUFFER_H
#define __UMC_AVS_COEFFS_BUFFER_H

#include "ippdefs.h"
#include "umc_structures.h"

namespace UMC
{

class AVSCoeffsBuffer
{
public:
    // Default constructor
    AVSCoeffsBuffer(void);
    // Destructor
    ~AVSCoeffsBuffer(void);

    // Initialize the buffer
    Status Init(size_t iMinPieceToWrite, Ipp32s iNumPieces);

    // Release the object
    Status Close(void);

    // Obtain the pointer to the free space
    Ipp16s *GetFree(void);
    // Obtain the pointer to the used space
    Ipp16s *GetUsed(void);

    // Advance the pointer to the free space
    void AdvanceFree(size_t iAdvance);
    // Advance the pointer to the used space
    void AdvanceUsed(size_t iAdvance);

    // Obtain current buffer size
    size_t GetBufferSize(void);

protected:

    Ipp16s *m_pBuffer;
    size_t m_iBufferSize;

    Ipp16s *m_pFree;
    size_t m_iFreeSize;

    Ipp16s *m_pUsed;
    size_t m_iUsedSize;

    size_t m_iDummy;

    size_t m_iMinPieceToWrite;
};

} // namespace UMC

#endif // __UMC_AVS_COEFFS_BUFFER_H
